package com.base.hong.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.base.hong.model.ProjectTitleEntity
import com.base.hong.ui.project.ChildProjectFragment

/**
 *
 *Create by Hong on 2023/3/10 22:49.
 *
 */
class ChildFragmentAdapter(
    var items: ProjectTitleEntity,
    fragmentManager: FragmentManager,
    lifecycle: Lifecycle
) : FragmentStateAdapter(fragmentManager, lifecycle) {

    override fun getItemCount() = items.size

    override fun createFragment(position: Int): Fragment {
        return ChildProjectFragment.newInstance(items[position].id)
    }
}